<div class="card bg-light">
  <span><%= link "新建节点", to: admin_node_path(@conn, :new), class: "btn btn-default btn-sm" %></span>
  <div class="toolbar">
    <%= form_for @conn, admin_node_path(@conn, :index), [method: :get, class: "form-inline"], fn f -> %>
      <div class="form-group mr-sm-2">
        <%= turbo_search_input f, "q[name_like]", class: "form-control btn-sm", placeholder: "名称" %>
      </div>
      <button class="btn btn-primary btn-sm">搜索</button>
    <% end %>
  </div>
  <div class="card-body">
    <table class="table table-bordered table-hover table-sm text-center">
      <thead>
        <tr>
          <th>#</th>
          <th>名称</th>
          <th>概况</th>
          <th>排序</th>
          <th>父节点</th>
          <th>创建时间</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <%= for node <- @nodes do %>
        <tr>
          <td><%= node.id %></td>
          <td><%= node.name %></td>
          <td><%= node.summary %></td>
          <td><%= node.position %></td>
          <td><%= node.parent_id %></td>
          <td><%= node.inserted_at %></td>
          <td>
            <span><%= link "", to: admin_node_path(@conn, :show, node), class: "fa fa-arrows-alt" %></span>
            <span><%= link "", to: admin_node_path(@conn, :edit, node), class: "fa fa-pencil" %></span>
            <span><%= link "", to: admin_node_path(@conn, :delete, node), method: :delete, data: [confirm: "Are you sure?"], class: "fa fa-trash" %></span>
          </td>
        </tr>
        <% end %>
      </tbody>
    </table>
  </div>
  <div class="card-footer">
    <%= render MiphaWeb.SharedView, "_pagination.html", assigns %>
  </div>
</div>
